package com.sjzl.dwr;

import org.springframework.stereotype.Service;

/**
 * 
 * @author 莫伯先
 *
 */
@Service
public class CheckTextNull {
	public boolean checkInputEdit(String inputEdit) {

		String oEditor = "oEditor";
		String OEditor = inputEdit + oEditor;
		int count = 0;
		for (int i = 0; i < OEditor.length(); i++) {
			if (OEditor.charAt(i) == '&' && OEditor.charAt(i + 1) == 'n'
					&& OEditor.charAt(i + 2) == 'b'
					&& OEditor.charAt(i + 3) == 's'
					&& OEditor.charAt(i + 4) == 'p'
					&& OEditor.charAt(i + 5) == ';') {
				count = i + 6;
				i = i + 5;
			}
			if (!(OEditor.substring(i + 1, i + 7).equals("&nbsp;"))) {
				i = OEditor.length() + 1;
			}

		}
		OEditor = OEditor.substring(count);
		System.out.println(OEditor);
		if (OEditor.equals(oEditor) || OEditor.equals("<br />"+oEditor)) {
			return false;
		}
		return true;
	}
}
